package com.readaloud.hibernate.user;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

@Entity
public class Comment implements Serializable{

	@Id @GeneratedValue(strategy = GenerationType.AUTO)
	private int commentId;
	private String commentDesc;
	
	@ManyToOne
	@JoinColumn(name = "bookId")
	@NotFound(action = NotFoundAction.IGNORE)
	private Books books;
	
	@ManyToOne
	//@JoinColumn(name = "readerId")
	@NotFound(action = NotFoundAction.IGNORE)
	private Reader reader;
	
	public int getCommentId() {
		return commentId;
	}
	public void setCommentId(int commentId) {
		this.commentId = commentId;
	}
	public String getCommentDesc() {
		return commentDesc;
	}
	public void setCommentDesc(String commentDesc) {
		this.commentDesc = commentDesc;
	}
	public Books getBooks() {
		return books;
	}
	public void setBooks(Books books) {
		this.books = books;
	}
	public Reader getReader() {
		return reader;
	}
	public void setReader(Reader reader) {
		this.reader = reader;
	}
	
}
